﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Spanner
{
    public partial class UI
    {
        public static TemplateModel<T> TemplateModel<T>(
            string name,
            Html html,
            Func<Param<T>, Act> initAct,
            params Model[] modelDependencies
        )
        {
            return new TemplateModel<T>(name, html, initAct, modelDependencies);
        }

        public static Expr<TemplateModel> NewTemplateModelInstance<T>(
            TemplateModel<T> templateModel,
            Expr<T> initArg
        )
        {
            return JSExpr<TemplateModel>("new " + templateModel.Name + "(#)", initArg);
        }
    }
}
